<include file="Public:header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/editormd/editormd.css?v=1.0"/>
<script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor-4.1.4/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor-4.1.4/lang/zh_CN.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/engine.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/jq_validate.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/editormd/editormd.js"></script>
<script type="text/javascript">
$(function(){
	$('#title').validate('required','请填写文章标题').validate('minlength',1,'标题长度1~160个字符').validate('maxlength',160,'标题长度1~160个字符').validate();
	$('#category_id').validate('selectRequired','请选择所属栏目').validate();
	$('#dataForm').submitValidate();	
	KindEditor.ready(function(K) {
	 K.create('textarea[name="content"]', {
                uploadJson :APP+'/Public/uploadByEditor/',
                fileManagerJson :APP+'/Public/fileManagerByEditor/',
                allowFileManager : true
     });
	});


    var testEditor;


    testEditor = editormd("test-editormd", {
        width   : "100%",
        height      : '600px',
        syncScrolling : "single",
        path    : "__PUBLIC__/admin/editormd/lib/",
        imageUpload : true,
        imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
        imageUploadURL : APP+'/Public/uploadByMarkdown/'
    });



});
</script>
<body class="mainBackground">
	<include file="Public:menu" />
	<div class="main" id="mainContainer">
        <!--发布-->
    	<div class="content_box">
        	<div class="content_box_t">
            	<h3 class="fl">
                <neq name="data[id]" value=''>
                编辑<else/>发布</neq>文章
                </h3>
            </div>
            <div class="content_box_c">
            	<form action="__ACTION__" method="post" id="dataForm" name="dataForm" enctype="multipart/form-data">
                                                  
                	<div class="field">
						<label>标题</label>
						<input class="text_input medium_input" type="text" name="title" id="title" value="{$data.title}" />
                        <span class="input_notification  png_bg" id="titleTip"></span>
						<small>必填</small>
					</div>
                	<div class="field pt15">
						<label>所属栏目</label>
						<select name="category_id" class="public_dropdown small_input" id="category_id"  type="select-one">
        					<option value="0">请选择所属栏目</option>
            				{$optionStr}
						</select>
                        <span class="input_notification  png_bg" id="category_idTip"></span>
					</div>
                	<div class="field pt15">
						<label>缩略图
                        	<neq name="data['thumb']" value="">(<a href="/uploadfile/original/{$data.thumb}" title="查看图片" target="_blank"  style="color:#F00;">查看图片</a>)</neq>
                        </label>
						<input class="text_input medium_input" type="file" name="photo" id="photo"/>
						<small>(图片格式：jpg,gif,png)</small>
					</div>                    
                	<div class="field pt15">
						<label>标签</label>
						<input class="text_input long_input" type="text" name="tags"  id="tagsHandle" value="{$tags}"/>
						<small>标签以“,”隔开</small>
					</div>
                	<div class="field pt15">
						<label>推荐位</label>
                        <volist name="flagArray"  id="vo">
                                <input type="radio" name="flag" value="{$vo.key}" 
                                <eq name="vo.key" value="$data[flag]">checked</eq>
                                />{$vo.title}
               			</volist>
					</div>
                	<div class="field pt15">
						<label>模板文件名</label>
						<input class="text_input small_input" type="text" name="tpl" id="tpl" value="{$data.tpl}" />
                        <small>用于发布插件信息</small>
					</div>                    
                	<div class="field pt15">
						<label>是否开放</label>
						<input type="checkbox" name="status"  value="1" <eq name="data.status" value="1"> checked</eq>/>是 
						<small>默认开放</small>
					</div>                    
                	<div class="field pt15">
						<label>简介</label>
						<textarea class="text_input" name="brief" id="brief" cols="79" rows="5">{$data.brief}</textarea><small>如果不填写则取详细内容部分填充</small>
					</div>
                	<div class="field pt15">
						<label>详细内容</label>
						<textarea class="text_input" name="content" style="width:99%;height:500px;">{$data.content|htmlspecialchars}</textarea>
					</div>
					<div class="field pt15">
						<label>详细内容</label>
						<div id="test-editormd">
                			<textarea style="display:none;" name="markdown_content">{$data.markdown_content}</textarea>
						</div>
					</div>
                	<div class="field pt15">
						<label>SEO标题</label>
						<input class="text_input medium_input" type="text" name="seo_title" value="{$data.seo_title}"/>
						<small>自定义标题,一般不超过80个字符</small>
					</div> 
                	<div class="field pt15">
						<label>SEO关键词</label>
						<input class="text_input medium_input" type="text" name="seo_keywords" value="{$data.seo_keywords}"/>
						<small>关键词以","隔开一般不超过100个字符</small>
					</div>
                	<div class="field pt15">
						<label>SEO描述</label>
						<textarea class="text_input" name="seo_description" cols="79" rows="5">{$data.seo_description}</textarea>
						<small>帮助SEO优化,一般不超过200个字符</small>
					</div>                                                           
                    <div class="field pt15 clearfix">
                    	<input type="hidden" name="id" value="{$data.id}"/>   
                    	<input type="submit" value="提交" class="public_button fr" />
                    </div>                                                                               
                </form>
            </div>
        </div>            
        <!--发布结束-->
    </div>




</body>
</html>
